package store.lunangangster.bpmn.model;

import org.apache.commons.lang3.StringUtils;

/**
 * FlowElement是所有可以出现在{@link Process}中的元素的抽象父类。
 * 其包含{@link FlowNode}和{@link SequenceFlow}
 * 
 * @author cwk
 * @version 1.0
 */
public abstract class FlowElement extends BaseElement {

  protected String name;
  protected FlowElementsContainer parentContainer;

  public String getName() {
    return name;
  }

  public void setName(String name) {
    this.name = name;
  }

  public FlowElementsContainer getParentContainer() {
    return parentContainer;
  }

  public void setParentContainer(FlowElementsContainer parentContainer) {
    this.parentContainer = parentContainer;
  }

  @Override
  public String toString() {
    if (StringUtils.isNotBlank(name)) {
      return getClass().getSimpleName() + ":" + name;
    }
    return super.toString();
  }
}
